<?php
defined('_JEXEC') or die;

jimport('joomla.application.component.modellist');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');

class WebideModelFiles extends JModelList {
	
	function getFiles(){
		//JLoader::import('manager', JPATH_ADMINISTRATOR.DS.'components'.DS.'com_media'.DS.'models');
		
		//$mediaManager = JModel::getInstance('manager', 'MediaModel', array('ignore_request' => true));
		
		//$files = $mediaManager->getFolderTree(JPATH_ADMINISTRATOR.DS.'components');
		
		//JLoader::import('manager', JPATH_ADMINISTRATOR.DS.'components'.DS.'com_media'.DS.'models');
		
		//$mediaManager = JModel::getInstance('manager', 'MediaModel', array('ignore_request' => true));
		
		//echo $mediaManager->getFolderList(JPATH_ADMINISTRATOR.DS.'components');
		
		$files = JFolder::folders(JPATH_ADMINISTRATOR.DS.'components');
		//dump($files, 'files');
		return $files;
	}
	/*function getListQuery() {
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select('id,name');
		$query->from('#__webide_options');
		return $query;
	}*/	
}